<layout name="layout"/>
<div class="panel admin-panel">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>增加内容</strong></div>
    <div class="body-content">
        <form name="main_form" class="form-x" id="myform" method="POST" action="__SELF__" enctype="multipart/form-data">
            <div class="form-group">
                <div class="label">
                    <label>默认主机名：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="" placeholder="请加上http://协议" name="zym"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>短网址配置：</label>
                </div>
                <div class="field">
                    <div><input type="radio" name="dwz" value="1">980.so
                    </div>
                    <div><input type="radio" name="dwz" value="2">suo.im
                    </div>
                    <div><input type="radio" name="dwz" value="3">c7.gg
                    </div>
                    <div><input type="radio" name="dwz" value="4">kks.me
                    </div>
                    <div><input type="radio" name="dwz" value="5">rrd.me
                    </div>
                    <div><input type="radio" name="dwz" value="6">uee.me
                    </div>
                    <div><input type="radio" name="dwz" value="7">6du.in
                    </div>
                    <div><input type="radio" name="dwz" value="8">nrw.so
                    </div>
                    <div><input type="radio" name="dwz" value="9">u6.gg
                    </div>
                    <div><input type="radio" name="dwz" value="10">t.cn
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button class="button bg-blue" type="button" id="submit"> 提交</button>
                    <input type="reset" value="重置" class="button bg-red">
                    <input type="button" value="取消" onclick="javascript :history.back(-1)" class="button bg-main">
                </div>
            </div>


        </form>
    </div>
</div>
<script src="__PUBLIC__/layui/layui.all.js"></script>
<script>

    $("#submit").click(function () {
        var data = $("#myform").serialize();
        console.log(data);
        $.post("<?php echo U('add')?>", data, function (res) {
            alert(res.info);
            location.href = res.url;
        })
    })


</script>
